package main.java.com.xiaowenxiong.controller.test;

/**
 * Created by 15c on 2017/4/26.
 */

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 运行
 */
public class Main {
    public static void main(String[] args) {
        //作为spring容器，接收一个配置类参数
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(DiConfig.class);
        //获得声明配置是UserFunctionService的Bean
        UserFunctionService userFunctionService = annotationConfigApplicationContext.getBean(UserFunctionService.class);
        System.out.print(userFunctionService.SayHello(" wang"));
        annotationConfigApplicationContext.close();
    }
}
